﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;

namespace WebSieuThi.TinHoc.QuanLiTaiKhoanAjax
{
    public partial class themus : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.QueryString["username"].ToString();
            string email = Request.QueryString["email"].ToString();
            int idmaloai = int.Parse(Request.QueryString["idmaloai"].ToString());
            DateTime ngaydk = DateTime.Parse(Request.QueryString["ngaydk"].ToString());

            TaiKhoanNguoiDung tk = new TaiKhoanNguoiDung();
            tk.UserName = username;
            tk.IdMaLoaiNV = idmaloai;
            tk.NgayDangKi = ngaydk;
            tk.Email = email;
            tk.MatKhau = "macdinh";

            bool b = TaiKhoanNguoiDungBUS.Them(tk);

            if (b)
            {
                Response.Write("Thêm thành công!");
            }
            else
            {
                Response.Write("Thêm thất bại!");
            }

        }
    }
}
